//
//  EassayTableViewCell.m
//  HumorousScripts
//
//  Created by 李欢 on 15/6/16.
//  Copyright (c) 2015年 李欢. All rights reserved.
//

#import "EassayTableViewCell.h"
#define Width [UIScreen mainScreen].bounds.size.width
#define Height [UIScreen mainScreen].bounds.size.height
@implementation EassayTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
//        背景图片
//        self.imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 30/375.0*Width + _y + 60/667.0*Height)];
//        self.imageView1.layer.cornerRadius = 20;
//        self.imageView1.clipsToBounds = YES;
//        self.imageView1.userInteractionEnabled = YES;
//
//        self.imageView1.image = [UIImage imageNamed:@"background.jpg"];
//        [self.contentView addSubview:self.imageView1];

        
        
        self.imageview = [[UIImageView alloc]initWithFrame:CGRectMake(10/375.0*Width, 10/667.0*Height, 40/375.0*Width, 40/667.0*Height)];
//        图片变成圆角
        self.imageview.layer.cornerRadius = 20;
        self.imageview.clipsToBounds = YES;
//        名字
        self.alabel = [[UILabel alloc]initWithFrame:CGRectMake(60/375.0*Width, 10/667.0*Height, 300/375.0*Width, 30/667.0*Height)];
        
//        内容
        self.label = [[UILabel alloc] initWithFrame:CGRectZero];
        _label.numberOfLines = 0;
        
        self.view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 80/667.0*Height + _y, [UIScreen mainScreen].bounds.size.width, 30/667.0*Height)];
        
        
        self.LastView = [[CellView alloc] initWithFrame:CGRectMake(0, 0, self.view1.frame.size.width / 4.0, 30/667.0*Height)];
        self.LastView.image.image = [UIImage imageNamed:@"iconfont-zanxuanzhong.png"];
        [self.view1 addSubview:self.LastView];
        self.LastView1 = [[CellView alloc] initWithFrame:CGRectMake(self.view1.frame.size.width / 4.0, 0, self.view1.frame.size.width / 4.0, 30/667.0*Height)];
        self.LastView1.image.image = [UIImage imageNamed:@"iconfont-zanweixuanzhong-2.png"];


        [self.view1 addSubview:self.LastView1];

        self.LastView2 = [[CellView alloc] initWithFrame:CGRectMake(self.view1.frame.size.width / 4.0 * 2.0, 0, self.view1.frame.size.width / 4.0, 30/667.0*Height)];
        self.LastView2.image.image = [UIImage imageNamed:@"iconfont-remen.png"];

        [self.view1 addSubview:self.LastView2];
        
        UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(self.view1.frame.size.width / 4.0 * 3.0, 0, self.view1.frame.size.width / 4.0, 30/667.0*Height)];
        [button setImage:[UIImage imageNamed:@"4.png"] forState:UIControlStateNormal];
        [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
        [self.view1 addSubview:button];

//        [self.imageView1 addSubview:_view1];
//        [self.imageView1 addSubview:self.imageview];
//        [self.imageView1 addSubview:self.alabel];
//        [self.imageView1 addSubview:self.label];
        [self.contentView addSubview:_view1];
        [self.contentView addSubview:self.imageview];
        [self.contentView addSubview:self.alabel];
        [self.contentView addSubview:self.label];

    
    }
    return self;
}

- (void)setAlabelFrame
{
//
    [self.imageView1 setFrame:CGRectMake(5, 0, [UIScreen mainScreen].bounds.size.width - 10, 30+ _y + 80 + 30 )];
//    [self.imageView1 setFrame:CGRectMake(5/375.0*Width, 0, [UIScreen mainScreen].bounds.size.width - 10/667.0*Height, 30/375.0*Width + _y + 80/667.0*Height)];

    [self.label setFrame:CGRectMake(10, 60, [UIScreen mainScreen].bounds.size.width- 20, _y + 30 )];
    [self.view1 setFrame:CGRectMake(0, 80+ _y + 30 , [UIScreen mainScreen].bounds.size.width, 30)];
    
}
- (void)buttonAction:(id)sender
{
    NSLog(@"%@", self.share);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

  
}

@end
